package com.itheima.demo;

import com.itheima.domain.User;
import com.itheima.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

/**
 *      使用spring配置创建bean对象 完成mybatis配置和第三方资源加载
 */
public class Demo {
    public static void main(String[] args) {
        //加载配置文件
        ApplicationContext ac = new ClassPathXmlApplicationContext("Spring.xml");
        //获取资源
        UserService userService = ac.getBean(UserService.class);
        List<User> list = userService.findAll();
        System.out.println(list);
    }
}
